package map.widget;

import java.awt.Insets;

import javax.swing.Action;
import javax.swing.JButton;

public class HButton extends JButton {

	private boolean showText = false;

	public HButton() {
		setMargin(new Insets(0, 0, 0, 0));
	}

	public HButton(boolean showtext) {
		this();
		setShowText(showtext);
	}

	public HButton(Action action) {
		this(action, false);
	}

	public HButton(Action action, boolean showtext) {
		setAction(action);
		setShowText(showtext);
	}

	public boolean isShowText() {
		return showText;
	}

	public void setShowText(boolean showText) {
		this.showText = showText;

	}

	public void setText(String text) {
		if (showText) {
			super.setText(text);
		}
	}

}
